<template>
		
		<view class="u-page__item " >
			<view class="my_nick">
				<!-- 使用open-data就不用调用接口去查找了 -->
				<u-avatar :src="src" shape="circle" size="50px"></u-avatar>
				<text class="my_nickName" space="nbsp">{{nickName}}</text>
				<text class="my_check" >查看信息</text>
				<!-- 小程序不支持<br/>唤行,可以使用\n -->
			</view>
			
			<!-- 配置url起作用,他封装了路由，可以传递参数-->
			<u-cell-group>
				<u-cell
				    icon="../../../../static/imags/accountManage.png"
				    size="large"
				    title="账号管理"
				    isLink="true"
					url="../../page_mine/accountManage/accountManage"
				></u-cell>
				<u-cell
				    icon="../../../../static/imags/personInformation.png"
					size="large"
				    title="个人信息"
				    isLink="true"
				    url="../../page_mine/personInformation/personInformation"
				></u-cell>
				<u-cell
				    icon="../../../../static/imags/memo.png"
					size="large"
				    title="备忘录"
				    isLink="true"
					url="../../page_mine/meno/meno?id=1"
				></u-cell>
				<u-cell
				    icon="../../../../static/imags/callCenter.png"
					size="large"
				    title="客服中心"
				    isLink="true"
				    @click="toAccountManage(id)"
				></u-cell>
			
			</u-cell-group>
			<!-- <button @click="logins">退出登录</button> -->
			<!-- <button @click="logins">测试登录</button> -->
		</view>
		
</template>
<script>
	// 使用alt键查看路径是否能够正确跳转
	import app from "../../App.vue"
	
	export default {
		data() {
			return {
				src: "https://thirdwx.qlogo.cn/mmopen/vi_32/FKOOSx20SicEzL6wLicVzjQtZ3D6jcHTxnPtb2cfMZQQbpTbe9YlyiborfTM0HDbeEMghcoiaaxjBBP6fj7F8cFYicA/132",
				nickName: "韦唐亮 ",
				id: ""
			}
		},
		
		onload() {
			//将页面初始化，将nickName等赋值
			
		},
		
		methods: {
			click() {
				console.log('Cell is clicked.');
			},

			logins() {
				uni.getUserProfile({
					desc:"用于完善用户信息",  //必填，声明获取用户个人信息后的用途，不超过30个字符
					success: (res) => {
						console.log(res)
						uni.showToast({
							icon:"success",
							title:'获取成功'
						})
						this.src = res.userInfo.avatarUrl
						this.nickName = res.userInfo.nickName 
					},
					fail: (err) => {
						console.log(err)
						uni.showToast({
							icon:"error",
							title:'用户拒绝获取'
						})
					}  
				})
			},
			
			//不能用于tabBar页面
			toAccountManage(id) {
				console.log('Cell is clicked.');
				wx.navigateTo({
					url: "../../page_chat/chat/chat"
				})
			}
		

		}
	}
</script>

<style lang="scss" scoped>
	
	.my_nick {
		  display: flex;
		  flex-direction: row;
		  // 字排列在中间
		  align-items: center;
		  justify-content: left;
		  margin-left: 30rpx;
		  margin-top: 10rpx;
		  // background-color: red;
	}
	
	.my_nick .my_nickName {
		font-size: 35rpx;
		padding-left: 40rpx;
		// background-color: pink;
	}
	
	 .my_nick .my_check {
		display: block;
		//移动到右边
		flex: 1;
		 // align-items: center;
		padding-right: 4rpx;
		text-align: right;
		color: #23b8ff;
		font-size: 32rpx;
		margin-right: 100rpx;
		// background-color: red;
	}
	
	
	// text{
	  
	  
	// }
	
	
	
	// .echart_content {
	// 	margin: 0 auto;
	// 	width: 650rpx;
	// 	height: 380rpx;
	// }
	
	.cell-page {
		padding-bottom: 20px;
	}

	.cell-box {
		&__title {
			font-size: 14px;
			color: rgb(143, 156, 162);
			margin: 20px 0px 0px 15px;
		}

		&__block {
			// background-color: #fff;
			margin-top: 20px;
		}
	}

	.u-page {
		padding: 0;

		&__item {

			&__title {
				color: $u-tips-color;
				background-color: $u-bg-color;
				padding: 15px;
				font-size: 15px;

				&__slot-title {
					color: $u-primary;
					font-size: 14px;
				}
			}
		}
	}

	.u-slot-title {
		@include flex;
		flex-direction: row;
		align-items: center;
	}

	.u-cell-text {
		font-size: 15px;
		line-height: 22px;
		color: #303133;
		margin-right: 5px;
	}

	.u-slot-value {
		line-height: 17px;
		text-align: center;
		font-size: 10px;
		padding: 0 5px;
		height: 17px;
		color: #FFFFFF;
		border-radius: 100px;
		background-color: #f56c6c;
	}
</style>
